package main

import (
	"cqsx/bmi"
    "cqsx/database"
    "cqsx/student"
    "cqsx/email"
	"fmt"
)

func main() {
	for i := 0; i < 3; i++ {
		if !database.Login() {
			goto amHere
		} else {
			fmt.Printf("登录%d次 失败", i+1)
			if i == 2 {
				fmt.Println("失败3次,关机")
				return
			}
		}
	}

amHere:
	for {
		var comand string
		fmt.Println("请输入正确的模块名：")
		fmt.Println("目前支持add,jianfa,chufa,chengfa,bmi")
		fmt.Scanln(&comand)
		switch comand {
		case "bmi":
			bmi.BMI()
        case "jiafen":
			student.JiaFen()
        case "student":
			student.ReadFile()
        case "email":
			email.SendEmail()    
		case "exit":
			break amHere
		}
		fmt.Println("后面请氪金，穷货别来！")
	}
}
